package com.dszq.apis.article.fallback;

import com.dszq.apis.article.IArticleClient;
import com.dszq.model.article.dtos.ArticleDto;
import com.dszq.model.common.dtos.ResponseResult;
import com.dszq.model.common.enums.AppHttpCodeEnum;
import org.springframework.stereotype.Component;

/**
 * feign失败配置
 * @author itdszq
 */
@Component
public class IArticleClientFallback implements IArticleClient {
    @Override
    public ResponseResult saveArticle(ArticleDto dto)  {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取数据失败");
    }
    /**
     * 删除文章
     *
     * @param id 文章ID，通过URL路径变量传递
     * @return 返回操作结果，包括成功与否、错误代码和错误信息等
     */
    @Override
    public ResponseResult deleteArticle(Long id) {
        return ResponseResult.errorResult(AppHttpCodeEnum.PARAM_INVALID,"文章删除失败");
    }
}